package org.xfs.flume.util;

import com.alibaba.fastjson.JSON;

public class JSONUtils {
	
	public static void main(String[] args) {
		System.out.println(isValidate("{\"dd\":1,\"test\":\"test\"}"));
		System.out.println(isValidate("aaa"));

	}

	//验证数据是json
	public static boolean isValidate(String log) {
		try {
			JSON.parse(log);
			return true;
		}catch (Exception e) {
			return false;
		}
	}

}
